-
Notifications
You must be signed in to change notification settings - Fork 274
Use PolarisImmutable for StorageCredentialCacheKey #2029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use PolarisImmutable for StorageCredentialCacheKey #2029
Conversation
39eac51
to
a23c4a0
Compare
+ ", allowedWriteLocations=" | ||
+ allowedWriteLocations | ||
+ '}'; | ||
return ImmutableStorageCredentialCacheKey.builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not delegate to the existing ImmutableStorageCredentialCacheKey.of(...)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it didnt exist until i added @Value.Parameter
, but done now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea - this, rather the whole change, is overall be a good improvement not just for the code, but also the "free" improvements like lazy/memoized hash values.
a23c4a0
to
b97764f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR LGTM "as is" (pure refactoring), but I think we need to follow up on including the the entity ID into the cache key.
/** | ||
* The entity id is passed to be used to fetch subscoped creds, but is not used to do hash/equals | ||
* as part of the cache key. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this PR does not change this behaviour, but conceptually if the entity ID is a substantial parameter to computing the cached value, I believe it should be included in the key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether I already mentioned it, but I'm not sure the StorageCredentialCache
works as expected, because when credentials are retrieved from the cache, we only know that those are valid at the time of retrieval, but not how long those will be valid (for a client), it could be 0.1ms or 30days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(But that's not a problem of this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Created #2046)
note that
entityId
was not part of theequals
/hashCode
and thus did not need to be a field